# $Id$
# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Miguel Revilla <yo at miguelrevilla.com>
# Contributor: David Sotelo <dvsotelo at gmail.com>
# Contributor: Nuno Araujo <nuno.araujo@russo79.com>

pkgname=qpdf
pkgver=8.2.1
pkgrel=1
pkgdesc="QPDF: A Content-Preserving PDF Transformation System"
arch=('x86_64')
url="https://github.com/qpdf/qpdf"
license=('custom:Artistic-2.0' 'Apache')
depends=('libjpeg-turbo' 'zlib')
optdepends=('perl:	required for fix-qdf')
checkdepends=('perl')
source=(#https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz{,.asc})
        https://github.com/qpdf/qpdf/releases/download/release-${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.gz{,.asc})
# sourceforge only offers sha1sums - see checksums at github
sha512sums=('ef3aeb4a7ca3ec48ab62341533eedcb2a6d0985767317ab72c22f0c0ecfef6849bfdc34b1bcec6427c7bde166143adb409c895ff40d8be6628e6323e27697a8c'
            'SKIP')
validpgpkeys=('C2C96B10011FE009E6D1DF828A75D10998012C7E') # "Jay Berkenbilt <ejb@ql.org>"

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr --disable-static
  make
}

check() {
  cd ${pkgname}-${pkgver}
  make check # passes all
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}/" install

  mkdir -m755 -p ${pkgdir}/usr/share/licenses/${pkgname}
  install -m644 {Artistic-2.0,LICENSE.txt} ${pkgdir}/usr/share/licenses/${pkgname}/
}
